/**
 * Copyright 2013-2015
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */	  

package com.cos.service.admin.dynamic;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cos.dao.DaoSupport;
import com.cos.entity.Page;
import com.cos.util.PageData;

/**
 * TODO 类或接口说明
 * <p/>
 * 
 * @author <a href="mailto:709920087@qq.com">lxj</a>
 * @version  Date: 2016年3月16日 下午2:39:19
 * @serial 1.0
 * @since 2016年3月16日 下午2:39:19
 */
@Service("userDynamicService")
public class UserDynamicService {

	@Autowired
	private DaoSupport daoSupport;
	
	/**
	 * 保存用户动态
	 * @param pd
	 * @throws Exception
	 */
	public void save(PageData pd) throws Exception {
		daoSupport.save("UserDynamicMapper.save", pd);
	}
	
	
	
	/**
	 * 删除用户动态
	 * @param pd
	 * @throws Exception
	 */
	public void delete(PageData pd)throws Exception{
		//System.out.println("Userdynamic---delete-----------------------------");
		daoSupport.delete("UserDynamicMapper.delete", pd);
	}
	
	
	
	/**
	 * 编辑用户动态
	 * @param pd
	 * @throws Exception
	 */
	public void edit(PageData pd)throws Exception{
		daoSupport.update("UserDynamicMapper.edit", pd);
	}
	
	
	/**
	 * 列表用户动态
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public List<PageData> list(Page page)throws Exception{
		return (List<PageData>)daoSupport.findForList("UserDynamicMapper.datalistPage", page);
	}
	
	/**
	 * 列表(全部)用户动态
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	public List<PageData> listAll(PageData pd)throws Exception{
		return (List<PageData>)daoSupport.findForList("UserDynamicMapper.listAll", pd);
	}
	
	/**
	 * 
	 * 通过id获取用户动态
	 * @param pd
	 * @return
	 * @throws Exception
	 */
	public PageData findById(PageData pd)throws Exception{
		return (PageData)daoSupport.findForObject("UserDynamicMapper.findById", pd);
	}
	
	/**
	 * 批量删除用户动态
	 * @param ArrayDATA_IDS
	 * @throws Exception
	 */
	public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
		daoSupport.delete("UserDynamicMapper.deleteAll", ArrayDATA_IDS);
	}
	
	/**
	 * 批量获取用户动态
	 * @param ArrayDATA_IDS
	 * @return
	 * @throws Exception
	 */
	public List<PageData> getAllById(String[] ArrayDATA_IDS)throws Exception{
		return (List<PageData>)daoSupport.findForList("UserDynamicMapper.getAllById", ArrayDATA_IDS);
	}
	
	
	
}
